#ifndef NAVIGATOR_H
#define NAVIGATOR_H

#include <QObject>
#include <QVariant>


class Navigator : public QObject
{
    Q_OBJECT
public:
    explicit Navigator(QObject *parent = 0);

    int currentPosition() const;
    QVariant currentElement() const;
    int elementCount() const;

public slots:
    void addElement(const QString& name, const QVariant& data);
    void addElementToPosition (const int position, const QString& name, const QVariant& data);
    void removeElementsFrom (const int position);
    void setCurrentPosition (const int position);

signals:
    void elementAdded (const QString& name);
    void dataAboutToBeRemoved (QVariant data);
    void lastElementRemoved();

private:
    void removeLastElement();

    QList<QVariant> m_elements;
    int m_currentPosition;
};


#endif // NAVIGATOR_H
